#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <map>

using namespace std;
using LL = long long;
using PII = pair<int, int>;


const int N = 5010;

int n, p, h, m;
LL d[N];

int main(){
    map<PII, bool> mp;
    cin >> n >> p >> h >> m;
    
    for(int i = 1; i <= m; i ++){
        int a, b;
        cin >> a >> b;
        if(a > b) swap(a, b);
        
        if(!mp.count({a, b})){
            mp[{a, b}] = true;
            d[a + 1] --, d[b] ++;
        }
    }
    
    for(int i = 1; i <= n; i ++){
        d[i] += d[i - 1];
        cout << d[i] + h << '\n';
    }
    
    return 0;
    
}